<?php

function convertDate($date)
{
    list($day, $month, $year) = explode(".", $date);
    return sprintf("%d-%02d-%02d", $year, $month, $day);
}
